﻿using System.Drawing;
using System.Runtime.InteropServices;

namespace RigLib
{
    class Structs
    {
        #region Nested type: POINT

        [StructLayout(LayoutKind.Sequential)]
        internal struct POINT
        {
            public int X;
            public int Y;

            public POINT(int x, int y)
            {
                X = x;
                Y = y;
            }

            public static implicit operator Point(POINT p)
            {
                return new Point(p.X, p.Y);
            }
        }

        #endregion

        #region Nested type: RECT

        internal struct RECT
        {
            /// <summary>
            ///   The y-coordinate of the lower-right corner of the rectangle
            /// </summary>
            public int Bottom;

            /// <summary>
            ///   The x-coordinate of the upper-left corner of the rectangle
            /// </summary>
            public int Left;

            /// <summary>
            ///   The x-coordinate of the lower-right corner of the rectangle
            /// </summary>
            public int Right;

            /// <summary>
            ///   The y-coordinate of the upper-left corner of the rectangle
            /// </summary>
            public int Top;

            public RECT(int left, int top, int right, int bottom)
            {
                Left = left;
                Top = top;
                Right = right;
                Bottom = bottom;
            }
        }

        #endregion

        #region Nested type: SIZE

        [StructLayout(LayoutKind.Sequential)]
        internal struct SIZE
        {
            public int cx;
            public int cy;

            public SIZE(int cx, int cy)
            {
                this.cx = cx;
                this.cy = cy;
            }
        }

        #endregion
    }
}
